package gui;

import java.awt.GridLayout;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JLabel;
import javax.swing.JPanel;

import etc.PlayerStats;

public class StatPanel extends JPanel implements Observer {
	JLabel cash, level, lives;
	
	public StatPanel() {
		super(new GridLayout(10, 1));
		cash = new JLabel();
		level = new JLabel();
		lives = new JLabel();
		add(cash);
		add(lives);
		add(level);
	}

	@Override
	public void update(Observable o, Object arg) {
		PlayerStats ps = (PlayerStats)o;
		cash.setText("money: "+ ps.cash +" sek");
		lives.setText("lives left: "+ ps.lives);
		level.setText("current level: "+ ps.level);
	}
}
